Skip to content

Make it possible to set timeout to health.NewPinger()#555

Merged
raphael merged 2 commits intogoadesign:mainfrom
tchssk:health-pinger-option-timeout
May 12, 2025
Merged

Make it possible to set timeout to health.NewPinger()#555
raphael merged 2 commits intogoadesign:mainfrom
tchssk:health-pinger-option-timeout

Conversation

@tchssk
Copy link
Copy Markdown
Member

@tchssk tchssk commented May 6, 2025

No description provided.

@tchssk tchssk force-pushed the health-pinger-option-timeout branch from b12ea63 to 6555671 Compare May 6, 2025 02:04
@codecov
Copy link
Copy Markdown

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.55%. Comparing base (06e0199) to head (379eb11).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #555      +/-   ##
==========================================
+ Coverage   85.39%   85.55%   +0.16%     
==========================================
  Files          39       39              
  Lines        2252     2257       +5     
==========================================
+ Hits         1923     1931       +8     
+ Misses        303      301       -2     
+ Partials       26       25       -1     
Flag Coverage Δ
micro 85.55% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tchssk tchssk requested a review from Copilot May 6, 2025 02:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for a configurable timeout in the NewPinger function, ensuring that health check requests can respect a timeout setting.

  • Introduces a new WithTimeout option.
  • Adds test cases to verify timeout behavior and updated options validation.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
health/pinger_test.go Updates tests with a timeout scenario and verifies the new timeout option.
health/pinger.go Integrates timeout into the client structure and uses it when making HTTP requests.

@tchssk tchssk force-pushed the health-pinger-option-timeout branch from 7726fab to a801961 Compare May 6, 2025 02:15
@tchssk tchssk force-pushed the health-pinger-option-timeout branch from a801961 to 379eb11 Compare May 6, 2025 02:17
@raphael
Copy link
Copy Markdown
Member

raphael commented May 12, 2025

This is great, thank you!

@raphael raphael merged commit 19aff92 into goadesign:main May 12, 2025
4 checks passed
@tchssk tchssk deleted the health-pinger-option-timeout branch May 13, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants